
//
//  YYT_YuedanLeftTableViewCell.m
//  AudioVisualFeast
//
//  Created by 张琪 on 16/3/1.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "QL_YuedanLeftTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation QL_YuedanLeftTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
   self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.beijing = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.beijing.contentMode = UIViewContentModeScaleToFill;
        self.beijing.clipsToBounds = YES;
        [self addSubview:self.beijing];
        
        self.touxiang = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.touxiang.clipsToBounds = YES;
        self.touxiang.layer.cornerRadius = 25;
        [self.beijing addSubview:self.touxiang];
        
        self.first = [[UILabel alloc]initWithFrame:CGRectZero];
        self.first.textColor = [UIColor whiteColor];
        self.first.font = [UIFont systemFontOfSize:14];
        [self.beijing addSubview:self.first];
        
        self.two = [[UILabel alloc]initWithFrame:CGRectZero];
        self.two.font = [UIFont systemFontOfSize:14];
        self.two.textColor = [UIColor redColor];
        [self.beijing addSubview:self.two];
        
        self.gaoqing = [[UILabel alloc]initWithFrame:CGRectZero];
        self.gaoqing.textColor = [UIColor colorWithRed:30/255.0 green:195/255.0 blue:153/255.0 alpha:1.0];
        self.gaoqing.font = [UIFont systemFontOfSize:14];
        [self.beijing addSubview:self.gaoqing];
        
        self.jifen = [[UILabel alloc]initWithFrame:CGRectZero];
        self.jifen.textColor = [UIColor colorWithRed:30/255.0 green:195/255.0 blue:153/255.0 alpha:1.0];
        self.jifen.font = [UIFont systemFontOfSize:14];
        [self.beijing addSubview:self.jifen];
        
        self.bofang = [[UILabel alloc]initWithFrame:CGRectZero];
        self.bofang.textColor = [UIColor colorWithRed:30/255.0 green:195/255.0 blue:153/255.0 alpha:1.0];
        self.bofang.font = [UIFont systemFontOfSize:14];
        [self.beijing addSubview:self.bofang];
        
    }return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.beijing.frame = CGRectMake(0, 0, WIDTH, 190);
    self.touxiang.frame = CGRectMake(10, 130, 50, 50);
    self.first.frame = CGRectMake(self.touxiang.frame.size.width+10, 132, WIDTH, 10);
    self.two.frame = CGRectMake(self.touxiang.frame.size.width + 10, 150, WIDTH, 10);
    self.gaoqing.frame = CGRectMake(self.touxiang.frame.size.width + 10, 167, 150, 10);
    self.jifen.frame = CGRectMake(self.gaoqing.frame.size.width + self.touxiang.frame.size.width - 20
                                  , 165, 100, 10);
    self.bofang.frame = CGRectMake(self.gaoqing.frame.size.width + self.touxiang.frame.size.width + 80, 165, 100, 10);
}

- (void)setModel:(QL_YuedanLeftModel *)model{
    _model = model;
    [self.beijing sd_setImageWithURL:[NSURL URLWithString:_model.playListBigPic] placeholderImage:[UIImage imageNamed:@"zhanweitu.png"]];
    [self.touxiang sd_setImageWithURL:[NSURL URLWithString:_model.smallAvatar] placeholderImage:[UIImage imageNamed:@"zhanweitu.png"]];
    self.first.text = _model.title;
    self.two.text = _model.nickName;
    self.gaoqing.text = [NSString stringWithFormat:@"收录高清MV%@首",_model.videoCount];
    self.jifen.text = [NSString stringWithFormat:@"获得积分:%@",_model.integral];
    self.bofang.text = [NSString stringWithFormat:@"播放:%@",_model.totalViews];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
